﻿using System;
using System.Text.RegularExpressions;
class EmailExtr
{
    static void Main()
    {
        string text = @" proba1@abv.bg or at validen@yahoo.com" +
                 "  ala@bala. This also: @proba.com. Neither this: a@b.c.";
        Console.WriteLine(text);
        Console.WriteLine();
        string[] words = text.Split(' ');

        for (int i = 0; i < words.Length; i++)
        {
            if (Regex.IsMatch(words[i], @"[\w.]{2,20}@[\w]{2,20}[.]{1}[\w.]{2,6}"))
            {
                Console.WriteLine("{0} - valid email", words[i]);
            }
        }
        Console.ReadLine();
    }
}

